# Contributor: Rasmus Thomsen <oss@cogitri.dev>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=telepathy-logger
pkgver=0.8.2
pkgrel=6
pkgdesc="Telepathy framework logging daemon"
url="https://telepathy.freedesktop.org/components/telepathy-logger/"
arch="all"
license="LGPL-2.1-or-later"
makedepends="
	dbus-glib-dev
	glib-dev
	gobject-introspection-dev
	intltool
	libxml2-dev
	libxslt
	python3
	sqlite-dev
	telepathy-glib-dev
	"
checkdepends="dbus"
subpackages="$pkgname-static $pkgname-dev $pkgname-doc"
source="https://telepathy.freedesktop.org/releases/telepathy-logger/telepathy-logger-$pkgver.tar.bz2
	python3.patch
	"

prepare() {
	default_prepare

	update_config_sub
	update_config_guess
}

build() {
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var \
		--enable-introspection
	make
}

check() {
	# All tests access the same database, so when running them in parallel
	# things go wrong
	make check -j1
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="f3eda26133a4c38eeb79b01cbe3b7801a5eb773e8b4e6ce621c47d3ca701025364c6b2b890caea00104f01ba85ae891a6fad82d7a9dc487fd7a980221cede451  telepathy-logger-0.8.2.tar.bz2
54e8accf12572245e3d02c971d3b2945a52b9e1eb124310ac3ceb80a30f18748ebd80e0cd8a363256e054380182bcd490e4fe6d2dfb68f7effb98f85747341c5  python3.patch"
